import { Switch, Tooltip } from 'antd';
import { tooltipLength } from '@/utils';
import { formatDecimalFour } from '../../../Acommon';
import pageStyles from '@/common/pageLayout.less';

const getTableColumns = () => {
  return [
    {
      title: '单位名称',
      dataIndex: 'useCompanyName',
      key: 'useCompanyName',
      visible: true,
      render: (text: string | null, record: Record<string, any>) => {
        return <div style={{ color: '100%', whiteSpace: 'nowrap', overflow: 'hidden', textOverflow: 'ellipsis' }}>{text}</div>;
      },
    },
    // {
    //   title: '部门编码',
    //   dataIndex: 'useDepartmentID',
    //   key: 'useDepartmentID',
    //   visible: true,
    //   render: (text: string, record: Record<string, any>) => {
    //     return (
    //       <Tooltip title={tooltipLength(text, 50)}>
    //         <span className={pageStyles['over-flow-hidden']}>
    //           <div style={{ color: '100%', whiteSpace: 'nowrap', overflow: 'hidden', textOverflow: 'ellipsis' }}>{text}</div>
    //         </span>
    //       </Tooltip>
    //     );
    //   },
    // },
    {
      title: '部门名称',
      dataIndex: 'useDepartmentName',
      key: 'useDepartmentName',
      visible: true,
      render: (text: string | null, record: Record<string, any>) => {
        return <div style={{ color: '100%', whiteSpace: 'nowrap', overflow: 'hidden', textOverflow: 'ellipsis' }}>{text}</div>;
      },
    },
    {
      title: '资产数量',
      dataIndex: 'statisticalNum',
      key: 'statisticalNum',
      visible: true,
      render: (text: string | null, record: Record<string, any>) => {
        return <div style={{ color: '100%', whiteSpace: 'nowrap', overflow: 'hidden', textOverflow: 'ellipsis', display: 'block' }}>{text}</div>;
      },
    },
    {
      title: '金额',
      dataIndex: 'statisticalPrice',
      key: 'statisticalPrice',
      visible: true,
      render: (text: string | null, record: Record<string, any>) => {
        return <div style={{ color: '100%', whiteSpace: 'nowrap', overflow: 'hidden', textOverflow: 'ellipsis' }}>{formatDecimalFour(text)}</div>;
      },
    },
  ];
};

export { getTableColumns };
